<template>
    <div>    
        <MySchool/>
        <!-- v-on和$emit联合实现子父传递数据 -->
        <!-- <MyStudent v-on:studentClick="studentClick"/> -->
        <!-- 可以简写成 -->
        <MyStudent @studentClick="studentClick"/>
    </div>
</template>

<script>
    import MySchool from "./components/MySchool"
    import MyStudent from "./components/MyStudent"
    export default {
        name:"App",
        components:{
            MySchool,
            MyStudent
        },methods:{
            studentClick(name){
                console.log('student clicked',name)
            }
        }
    }
</script>
